<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>测试jstl格式化库</title>

	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

  </head>
  
  <body>
    <a href="jstlfmt.do">测试jstl格式化库</a>
    <hr>
    <li>测试格式化日期</li>
    date=${date }<br>
    date=<fmt:formatDate value="${date}"/><br>
    date=<fmt:formatDate value="${date}" type="date"/><br>
    time=<fmt:formatDate value="${date}" type="time"/><br>
    both=<fmt:formatDate value="${date}" type="both"/><br>
    short=<fmt:formatDate value="${date}" dateStyle="short"/><br>
    medium=<fmt:formatDate value="${date}" dateStyle="medium"/><br>
    long=<fmt:formatDate value="${date}" dateStyle="long"/><br>
    full=<fmt:formatDate value="${date}" dateStyle="full"/><br>
    date=<fmt:formatDate value="${date}" pattern="yyyy/MM/dd HH:mm:ss"/><br>
   	now=<fmt:formatDate value="${date}" pattern="yyyy/MM/dd HH:mm:ss" var="today"/>
    ${today}<br>
    <li>测试格式化数字</li><br>
    n(default):<fmt:formatNumber value="${n}"/><br>
    n(pattern="##,###.##"):<fmt:formatNumber value="${n}" pattern="##,###.##"/><br>
    n(pattern="##,###.0000"):<fmt:formatNumber value="${n}" pattern="##,###.0000"/><br>
    n(groupingUsed="false"):<fmt:formatNumber value="${n}" groupingUsed="false"/><br>
    n(minIntegerDigits="8"):<fmt:formatNumber value="${n}" minIntegerDigits="10"/><br>
    n(type="currency"):<fmt:formatNumber value="${n}" type="currency"/><br>
    n(currencySymbol="$"):<fmt:formatNumber value="${n}" type="currency" currencySymbol="$"/><br>
    p(type="percent"):<fmt:formatNumber value="${p}" type="percent" minFractionDigits="2" maxFractionDigits="2"/><br>
    
    
  </body>
</html>
